<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        // 1. 获取当前日期对象
        const date = new Date()
        console.log(date)

        // 2. 获取指定日期的对象
        const d1 = new Date("2021-01-01 8:3:31")
        console.log(d1)

        

    </script>
    
</body>
</html>